package com.ymatou.iapi.usersafe.service;

import org.json.JSONObject;

import com.ymt.base.YmatouBaseCall;
import com.ymttest.utils.EnvSetup;
/**
*验证用户安全Call
*FreeMaker Template自动生成代码
*/
public class VerifyCall extends YmatouBaseCall{
	private static String opurl ="api/safe/verify";
	
	public VerifyCall() {
		super(EnvSetup.getSystemUrl("usersafe"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	public Integer getCode() {
		Integer SubCode = 0;
		try {
			SubCode = this.getJsonObject().getAsJsonObject("Result").get("Code").getAsInt();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return SubCode;
	}
	public String getAuthMessage() {
		String AuthMessage = null;
		try {
			AuthMessage = this.getJsonObject().getAsJsonObject("Result").get("AuthMessage").getAsString();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return AuthMessage;
	}
}